class ScoreError(Exception):
    def __init__(self, msg, code, input_score):
        super().__init__(msg)
        self.code = code
        self.msg = msg
        self.input_score = input_score


class Wife:
    def __init__(self, name, age, score):
        self.name = name
        self.age = age
        self.score = score

    @property
    def name(self):
        return self.__name

    @name.setter
    def name(self, name):
        self.__name = name

    @property
    def age(self):
        return self.__age

    @age.setter
    def age(self, age):
        self.__age = age

    @property
    def score(self):
        return self.__score

    @score.setter
    def score(self, score):
        if 0 <= score <= 100:
            self.__score = score
        else:
            raise ScoreError('成绩超出1~100之间', 501, score)


try:
    wife = Wife('王昭君', 23, 1000)
except ScoreError as e:
    print(e.msg)
